// The payment page
// ================

define(['zepto', 'utils', 'wxupload', 'wxshare', 'cityPicker'], function($, utils, wxupload, wxshare) {
  return {

    init: function(data) {
      
      // forbidden wx share
      
      //wxshare.initShare(data.jsConfig, false)
      
      this.bindProtocolAgreeButton();
   
    },
    
    bindProtocolAgreeButton: function() {

        var $button  = $(".protocol a.btn"),
            $time    = $(".protocol a.btn span"),
            duration = 5;

        var countdown = setInterval(function(){
          if (--duration) {
            $($time).text(duration);
          // Otherwise
          } else {

            // Clear the countdown interval
            clearInterval(countdown)
            // And fire the callback passing our container as `this`
            $($time).text('');
            $($button).removeClass('btn-disabled');
   
            $($button).attr('href', $($button).data("href"));
          }
     　       }, 1000);
      
    }
  }
})